#!/usr/bin/env python
# -*- coding:utf-8 -*-

from handle.HandleBase import HandleBase


class HandleGroup(HandleBase):
    '组信息处理类'
    def __init__(self, environ):
        from util.sqldata import ModelGroupInfo

        super(HandleGroup, self).__init__(environ)
        self._group_info = ModelGroupInfo()

    def action_index(self):
        '查询组信息'
        record = self._group_info.get_all_with_count()
        self._view['record'] = record

    def action_mm(self):
        '查询mm比例'
        record = self._group_info.get_mm_ratio()
        self._view['record'] = record
